<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String type = (String) request.getParameter("type")==null?"":(String) request.getParameter("type");
String grade = (String) request.getParameter("grade")==null?"":(String) request.getParameter("grade");
%>
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    <title>蓝居整租</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"> 
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="<%=basePath%>js/bootstrap-3.3.5-dist/css/bootstrap.min.css">
	<link href="css/mui.min.css" rel="stylesheet" type="text/css" />
	<link href="css/weui/weui.css" rel="stylesheet" type="text/css" />
	<link href="<%=basePath%>css/lanzuZhengzu.css" rel="stylesheet">
  </head>
  <script src="<%=basePath%>js/jquery-2.1.1.js"></script>
  <script src="<%=basePath%>js/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
  <script src="<%=basePath%>js/min/jquery-v1.10.2.min.js" type="text/javascript"></script>
   <script src="<%=basePath%>js/min/modernizr-custom-v2.7.1.min.js" type="text/javascript"></script>
   <script src="<%=basePath%>js/min/hammer-v2.0.3.min.js" type="text/javascript"></script>
   <link href="<%=basePath%>css/flickerplate.css"  type="text/css" rel="stylesheet">
   <script src="<%=basePath%>js/min/flickerplate.min.js" type="text/javascript"></script>
      <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
     <script>
     var path = "<%=path%>";
     var type = "<%=type%>";
     var grade = "<%=grade%>";
     var nonce="";//生成签名的随机串
     var signature="";//签名
     var timestamp="";//时间戳
     var title="欢迎使用蓝居";
     var desc="这是蓝居管家首页，欢迎使用";
     var sharLink="http://nvstop.cn/LanJuPublic/lanju/home.jsp";
     var imgUrl="http://nvstop.cn/LanJuPublic/images/lanju.jpg";
     var basePath="<%=basePath%>";
     $(document).ready(function(){  
   	  var url = encodeURI(location.href.split('#')[0]);
   	  $.ajax({
   	         url: basePath+"/weixinImpl/getEncryptJsapiTicket.spring?rn="+(new Date().getTime()),
   	         type: "POST",
   	         data:{"url":url},
   	         dataType: "json",
   	         success: function(data){
   	        	 if(data != null){
   	        		 nonce=data.nonce;
   		             signature=data.signature;
   		             timestamp=data.timestamp;
   		             loadWx();
   	        	 }
   	             
   	          },
   	          error:function(err){
   	            console.log('异常');
   	          }
   	        });
   });
     
     function loadWx(){
   	  wx.config({
   		    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
   		    appId: 'wxb3b7beee9190b2ef', // 必填，公众号的唯一标识wxd894029b9bdb4b67
   		    timestamp: timestamp, // 必填，生成签名的时间戳
   		    nonceStr: nonce, // 必填，生成签名的随机串
   		    signature: signature,// 必填，签名
   		    jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ'] // 必填，需要使用的JS接口列表
   		});
   	  wx.ready(function(){
   		  //新版本，还没支持
//    		  wx.updateAppMessageShareData({ 
//    		        title: title, // 分享标题
//    		        desc: desc, // 分享描述
//    		        link: sharLink, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
//    		        imgUrl: imgUrl, // 分享图标
//    		}, function(res) { 
   			
//    		这里是回调函数 
//    		}); 
   		  
//    		  wx.updateTimelineShareData({ 
//    		        title: title, // 分享标题
//    		        link: sharLink, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
//    		        imgUrl: imgUrl, // 分享图标
//    		}, function(res) { 
//    			alert(res);
//    		这里是回调函数 
//    		}); 
   		  //分享到朋友圈
   		  wx.onMenuShareTimeline({
   			    title: title, // 分享标题
   			    link: sharLink, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
   			    imgUrl: imgUrl, // 分享图标
   			    desc: desc, // 分享描述
   			    success: function () {
   			    // 用户确认分享后执行的回调函数
   				},
   			cancel: function () {
   			    // 用户取消分享后执行的回调函数
   		    }
   		});
   		  //分享到朋友
   		  wx.onMenuShareAppMessage({
   			  title: title, // 分享标题
   			  desc: desc, // 分享描述
   			  link: sharLink, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
   			  imgUrl: imgUrl, // 分享图标
   			  type: 'link', // 分享类型,music、video或link，不填默认为link
   			  dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
   			  success: function () {
   			  // 用户确认分享后执行的回调函数
   			  },
   			  cancel: function () {
   			  // 用户取消分享后执行的回调函数
   			  }
   			  });
   		  //分享到QQ
   		  wx.onMenuShareQQ({
   			  title: title, // 分享标题
   			  desc: desc, // 分享描述
   			  link: sharLink, // 分享链接
   			  imgUrl: imgUrl, // 分享图标
   			  success: function () {
   			  // 用户确认分享后执行的回调函数
   			  },
   			  cancel: function () {
   			  // 用户取消分享后执行的回调函数
   			  }
   			  });
   	  });
   	  
   	  wx.error(function(res){
   		
   	  });
   	  
   }
        $(function(){
            var w_height = $(window).height();
            $('.menu').css('height',w_height);

            //   弹出右边菜单
            $('.menu_show').click(function(){
                $('.menu,.b_mark').css('display','block');
                $('.menu .menu_con').stop().animate({ right: '0' }, 300);
                flagArr = [];
            });
            $('.menu .b_mark').click(function(){
                $('.menu .menu_con').stop().animate({ right: '-70%' }, 300);
                setTimeout(function(){
                    $('.menu,.b_mark').fadeOut('fast');
                },250);
            });

        });
        
        function search(){

        	$(".house_ul").html("");

        	Zezu.initList();
        }
        
        function more(){
        	$("#loadmore").show();
        	$(".page__desc").hide();
        	offset = offset+limit;
        	Zezu.initList();
        }
    </script>
    
   
  <body>

<main>

    <section class="menu" style="z-index: 999">
        <span class="b_mark" ></span>
        <div class="menu_con" >
            <p class="m_tit">筛选</p>
            <ul class='allselect'>
            <li style="width: 100%">
            <div class='span_content'>
              <span class='span_title'>房型</span>
              <ul id="layout">
              		<!-- <li><a>一房一厅</a></li>
              		<li><a>两房一厅</a></li> -->
              </ul>
            </div>
            </li>
            <li style="width: 100%">
            <div class='span_content'>
              <span class='span_title'>朝向</span>
              <ul id="towards">
              		<!-- <li><a>一房一厅</a></li>
              		<li><a>两房一厅</a></li> -->
              </ul>
            </div>
            </li>
            <li style="width: 100%">
            <div class='span_content'>
              <span class='span_title'>房子标签</span>
              <ul id="houseFlag">
              		<!-- <li><a>一房一厅</a></li>
              		<li><a>两房一厅</a></li> -->
              </ul>
            </div>
            </li>
	            <li style="width: 100%">
	            <div class='span_content'>
	              <span class='span_title'>房型</span>
	              <ul>
	              		<li><a>一房一厅</a></li>
	              		<li><a>两房一厅</a></li>
	              </ul>
	            </div>
	            </li>
           
            </ul>
            
            <div class="bottom"><button id="save">确认</button> </div>
        </div>
    </section>
</main>

    <div class="container" > 
    <header id="header" class="mui-bar mainBar pinkBar" style="height: 45px;background: #fff"> 
	<div style="background:#fff;height: 45px;">
		
	<div class="top_rg">
	
			<input id="search" name="search" class="search tui-number-cell" style="-webkit-user-select:auto" placeholder="请输入小区/地铁/户型等关键词"/>
			<a href="javaScript:search()">
			<img alt="" src="<%=basePath%>images/search.png" style="width: 25px;float: right;    margin-top: -32px; position: relative;margin-right: 10px;" >
			</a>
	</div>
	
	</div>
  </header>
	<jsp:include page="./footer.jsp"></jsp:include>
	 <div class="mui-content  "  > 
	
	<div class="tuijian_house">
		<div style="margin-top:25%;font-size: 15px;">
		<ul id="optMenu">
			<li><a id="menu" class="menu_show"><span style="margin-left: 5px;">筛选</span> <img alt="" src="<%=basePath%>images/sore.png"  style="width: 25px;height: 25px;vertical-align: -webkit-baseline-middle;"> </a></li>
			<li><a ><span class="publish desc">发布时间</span> <img alt="" src="<%=basePath%>images/sort.png"  style="width: 16px;height:16px;vertical-align: -webkit-baseline-middle;"> </a></li>
		</ul>
		</div>
		
		
		<div class="tuijian_house_content" style="margin-top: 30px;border-top:1px solid #f3f3f3 " >
			<div>
			<ul class="house_ul">
				<%-- <li>
					<img class="tuijian_house_content_img" src="<%=basePath%>images/binner1.jpg">
					<div class="house_title">北京理工大学整租</div>
					<div class="house_title house_price"><span class="house_size">15平方</span><span class="house_type">两房一厅</span><span class="price">1800元/月</span></div>
					<div class="house_title house_address"><span class="jiaotong"><img src="<%=basePath%>images/postion.png" class="position">高铁站</span> </div>
					
				</li>
				 --%>
			</ul>
			<div style="text-align: center;margin-top: -16%">
			<div class="weui-loadmore" style="display: none" id="loadmore">
	            <i class="weui-loading"></i>
	            <span class="weui-loadmore__tips">正在加载</span>
      		 </div>
      		 <p class="page__desc"  onclick="more()">加载更多</p>
      		 <!-- 如果没有数据需要展示暂无数据 -->
			</div>
			</div>
			
		</div>
		
	</div>
	
	 </div>
	  <div id="menu-backdrop" class="menu-backdrop2"></div>
	 </div>
	</header>
	<jsp:include page="./footer.jsp"></jsp:include>
	

	  <div id="menu-backdrop" class="menu-backdrop2"></div>
	 </div>
	 

	 
<script src="js/mui.min.js"></script>
<script src="<%=basePath%>lanju/js/lanjuZhengzu.js"></script>
<script type="text/javascript" charset="utf-8">
	mui.init({
		swipeBack : false
	//启用右滑关闭功能
	});
	var slider = mui("#slider");
	slider.slider({
		interval : 5000
	});

	var offset = 0;//起始页码
	var limit = 2;//每页个数
	var orderBy = "h.createTime desc";//默认降序
	var flagArr = new Array();
	
	$(function(){
		$('.flicker-example').flickerplate({
            auto_flick 				: true,
            auto_flick_delay 		: 8,
            flick_animation 		: 'transform-slide'
        });
		
		Zezu.initList();
		Zezu.queryAllFlag();
		
		$(".publish").on('click',function(){
			if($(this).hasClass("desc")){
				$(this).removeClass("desc");
				orderBy = "h.createTime";
			}else{
				$(this).addClass("desc");
				orderBy = "h.createTime desc";
			}
			$(".house_ul").html("");
			offset = 0;
			Zezu.initList();
		})
		
		$(".allselect .span_content ul").on('click','li a',function(){
			$(this).css("background-color","#FF6633");
			if($(this).hasClass("active")){
				$(this).removeClass("active");
				$(this).css("background-color","#f9f9f9");
			}else{
				$(this).addClass("active");
				$(this).css("background-color","#FF6633");
			}
		})
		
		$("#save").on('click',function(){
			$(".allselect .span_content ul li a").each(function(){
				if($(this).hasClass("active")){
					var id  = $(this).parent().attr("id");
					flagArr.push(id);
				}
			})
			$(".house_ul").html("");
			Zezu.initList();
			$('.menu .b_mark').click();
		})
		
		$(".house_ul").on("click","li",function(){
			var houseId  = $(this).attr("id");
			mui.openWindow({// 没有的前往关联商户
				url : 'lanju/houseDetails.jsp?houseId='+houseId,
				id : 'info'
			});
		})
	});
	</script>
</body>
</html>
